const fs = require("fs");
const path = require("path");
const upper = require("upper-case");
let filePath = path.join(__dirname, "from.txt");
let writePath = path.join(__dirname, "to.txt");
let reader = fs.createReadStream(filePath);
let writer = fs.createWriteStream(writePath);
reader.on('data', function (chunk) {
    // console.log(chunk.toString());
    // console.log(upper.upperCase(chunk.toString()))
    writer.write(upper.upperCase(chunk.toString()));
})

//pipe管道，可以将流之间进行连接
// reader.pipe(writer);


